package com.zzyl.service.impl;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.zzyl.base.PageResponse;
import com.zzyl.mapper.AlertDataMapper;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class AlertDataServiceImpl implements AlertDataService {
    @Autowired
    private AlertDataMapper alertDataMapper;
    @Override
    public PageResponse<AlertDataVo> page(Integer pageNum, Integer pageSize, Long endTime, String deviceName, Long startTime, Integer status) {
        PageHelper.startPage(pageNum,pageSize);
        Page<AlertDataVo> page=alertDataMapper.page(endTime,startTime, deviceName,status);
        return PageResponse.of(page, AlertDataVo.class);
    }
}
